package me.baicai.weixin.conf;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;


/**
 * @description:
 * @author: [ 超级大白菜 ]
 * @date: 2019-11-09 16:35
 */

@Component
public class WeiXinKey
{


    // 小程序 appId
    public static String appid;

    // 小程序 appSecret
    public static String secret;

    public static String mchid;

    public static String passwd;

    public final static String unifiedorder = "https://api.mch.weixin.qq.com/pay/unifiedorder";

    public final static String refund = "https://api.mch.weixin.qq.com/secapi/pay/refund";

    public final static String withdrawal = "https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/transfers";

    public final static String sendmessage = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=ACCESS_TOKEN";

    public static String ACCESS_TOKEN = "";


    // 授权类型
    final public static String grant_type = "authorization_code";

    public static String notify;

    public static String ip;

    public static String keyStore;

    @Value("${weixin.appid}")
    public void setAppid(String appid)
    {
        WeiXinKey.appid = appid;
    }

    @Value("${weixin.secret}")
    public void setSecret(String secret)
    {
        WeiXinKey.secret = secret;
    }

    @Value("${weixin.mchid}")
    public void setMchid(String mchid)
    {
        WeiXinKey.mchid = mchid;
    }

    @Value("${weixin.passwd}")
    public void setPasswd(String passwd)
    {
        WeiXinKey.passwd = passwd;
    }

    @Value("${weixin.notify}")
    public void setNotify(String notify)
    {
        WeiXinKey.notify = notify;
    }

    @Value("${weixin.ip}")
    public void setIp(String ip)
    {
        WeiXinKey.ip = ip;
    }

    @Value("${weixin.keyStore}")
    public void setKeyStore(String keyStore)
    {
        WeiXinKey.keyStore = keyStore;
    }
}
